package com.honeybee.cloud.framework.common.enums;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description 数据作废
 * @Author DELL
 * @Create 2019-01-10
 * @Since 1.0.0
 */
@Getter
public enum DeprecatedEnum {
    /**
     * 已作废
     */
    YES(1),
    /**
     * 未作废
     */
    NO(0);
    private Integer value;


    DeprecatedEnum(Integer value) {
        this.value = value;
    }

    private static final Map<Integer, DeprecatedEnum> ENUM_MAP = new HashMap(values().length);

    public static DeprecatedEnum fromValue(Integer value) {
        DeprecatedEnum deprecatedEnum = ENUM_MAP.get(value);
        return deprecatedEnum == null ? NO : deprecatedEnum;
    }

    public int value() {
        return this.value;
    }

    static {
        DeprecatedEnum[] var0 = values();
        int var1 = var0.length;

        for (int var2 = 0; var2 < var1; ++var2) {
            DeprecatedEnum methodEnum = var0[var2];
            ENUM_MAP.put(methodEnum.value, methodEnum);
        }

    }
}
